package com.uchedao.seller.ui.car.manage;

import android.support.v4.app.Fragment;

import com.uchedao.seller.R;
import com.uchedao.seller.ui.baidu.BaseFragForBaidu;
import com.uchedao.seller.widget.MyTabView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 车辆管理
 * Created by zhengxizhen on 15/10/19.
 */
public class CarManageFragment extends BaseFragForBaidu {

    private MyTabView tabView;

    private static BaseFragForBaidu mInstance = null;

    /**
     * 获取单例
     */
    public static synchronized BaseFragForBaidu getInstance() {
        if (mInstance == null) {
            mInstance = new CarManageFragment();
        }
        return mInstance;
    }

    @Override
    protected String getActivityTag() {
        return "CarManageFragment";
    }

    @Override
    public int getViewLayoutId() {
        return R.layout.fragment_car_manage;
    }

    @Override
    public void initView() {
        tabView = (MyTabView) mRoot.findViewById(R.id.tabCarManage);
        List<Map<String,Integer>> titles = new ArrayList<Map<String,Integer>>();
        Map<String,Integer> map = new HashMap<String, Integer>();
        map.put(getResources().getString(R.string.title_bidding_car), null);
        titles.add(map);
        map = new HashMap<String, Integer>();
        map.put(getResources().getString(R.string.title_bid_end_car), null);
        titles.add(map);
        map = new HashMap<String, Integer>();
        map.put(getResources().getString(R.string.title_for_sale), null);
        titles.add(map);

        List<Fragment> fragments = new ArrayList<Fragment>();
        fragments.add(new CarBiddingFragment());
        fragments.add(new CarBidEndFragment());
        fragments.add(new CarForSaleFragment());
        tabView.createView(titles, fragments, getChildFragmentManager());
    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }
}
